From 167c6119eb65aea6374b6ea5d5df7346040b0c9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Sun, 10 May 2020 16:55:03 +0200 Subject: [PATCH] widget: Move adjusted size calculation below early-out goto --- gtk/gtkwidget.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 479d9b6669..ed6c3fc091 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -3951,12 +3951,6 @@ gtk_widget_allocate (GtkWidget *widget, adjusted.x += border.left + padding.left; adjusted.y += border.top + padding.top; - /* Since gtk_widget_measure does it for us, we can be sure here that - * the given alloaction is large enough for the css margin/bordder/padding */ - adjusted.width -= border.left + padding.left + - border.right + padding.right; - adjusted.height -= border.top + padding.top + - border.bottom + padding.bottom; if (baseline >= 0) baseline -= margin.top + border.top + padding.top; if (adjusted.x || adjusted.y) @@ -3971,6 +3965,13 @@ gtk_widget_allocate (GtkWidget *widget, if (!alloc_needed && !size_changed && !baseline_changed) goto skip_allocate; + /* Since gtk_widget_measure does it for us, we can be sure here that + * the given alloaction is large enough for the css margin/bordder/padding */ + adjusted.width -= border.left + padding.left + + border.right + padding.right; + adjusted.height -= border.top + padding.top + + border.bottom + padding.bottom; + priv->width = adjusted.width; priv->height = adjusted.height; priv->baseline = baseline; -- 2.30.2